/******************************************************************************
*
* This file is part of FreeTrack (http://code.google.com/p/qtfreetrack).
* BY Willy Gardiol (willy@gardiol.org)
*
* FreeTrack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FreeTrack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Foobar.  If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
#ifndef FREETRACK_H
#define FREETRACK_H

#include <QtGui>
#include "controls/rotatingdialog.h"

class TracksManager;
class MapsManager;
class TrackTable;
class GpsManager;
class SystemControls;
class StatusBar;
class LiveTrack;

class TrackAway : public RotatingDialog
{
    Q_OBJECT
public:
    explicit TrackAway();
    ~TrackAway();

    void closeEvent(QCloseEvent *);

public slots:
    void showAbout();

private:
    // The widget to hold the central widgets
    QStackedWidget * center;

    void createLivetrack();
    void createMapsManager();
    void createTracksManager();
    void createTrackingTable();
    void createGpsManager();
    void createSystemControls();
    void createStatusBar();

    // Central Widgets
    TracksManager * tracksManager;
    MapsManager   * mapsManager;
    TrackTable    * trackingTable;
    GpsManager    * gpsManager;
    SystemControls* systemControls;
    StatusBar     * statusBar;
    LiveTrack     * livetrack;

    QLayout* createVertical();
    QLayout* createHorizontal();

private slots:
    // quit
    void askQuit();
    // show modal dialogs
    void showConfig();

    // livetrack
    void showLivetrack();

    // Show widgets
    void showWidget(int);

    // Save tracks and stuff before exit
    void prepareToQuit();

};

#endif // FREETRACK_H
